﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using Phoenix.AppCode.Entities;
using Phoenix.AppCode.Data;
using System.Data;

namespace Phoenix.AppCode.Bussiness
{
    public class ArticleService
    {
        public ArticleService() 
        {
            //
            // TODO: Add constructor logic here
            //    
        }
        public static DataTable ArticleGetById(Article article)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            return articleDAO.ArticleGetById(article);
        }
        public static DataTable ArticleDetails(Article article)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            return articleDAO.ArticleDetails(article);
        }
        public static DataTable ArticleLoadService(Article article)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            return articleDAO.ArticleLoadService(article);
        }
        #region Backend Method
        /// <summary>
        /// Create 
        /// </summary>
        /// <param name="article"></param>
        public static void Create(Article article)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            articleDAO.Create(article);
        }

        /// <summary>
        /// Edit
        /// </summary>
        /// <param name="article"></param>
        public static void Edit(Article article)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            articleDAO.Edit(article);
        }

        /// <summary>
        /// On/Off
        /// </summary>
        /// <param name="article"></param>
        public static void OnOff(Article article)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            articleDAO.OnOff(article);
        }

        /// <summary>
        /// Delete
        /// </summary>
        /// <param name="article"></param>
        public static void Delete(Article article)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            articleDAO.Delete(article);
        }

        /// <summary>
        /// Show category all
        /// </summary>
        /// <param name="language"></param>
        /// <returns></returns>
        public static DataTable ArticleCategoryList(string language)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            return articleDAO.ArticleCategoryList(language);
        }

        /// <summary>
        /// Show all
        /// </summary>
        /// <param name="language"></param>
        /// <returns></returns>
        public static DataTable spArticleListByIdCat(int idarticlecategory, string language)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            return articleDAO.spArticleListByIdCat(idarticlecategory,language);
        }

        /// <summary>
        /// Show data by ID
        /// </summary>
        /// <param name="idarticle"></param>
        /// <returns></returns>
        public static DataTable ArticleList_GetByID(int idarticle)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            return articleDAO.ArticleList_GetByID(idarticle);
        }

        /// <summary>
        /// Get ID to edit or delete 
        /// </summary>
        /// <param name="idarticle"></param>
        /// <returns></returns>
        public static Article GetArticleByID(int idarticle)
        {
            ArticleDAO articleDAO = new ArticleDAO();
            return articleDAO.GetArticleByID(idarticle);
        }
        #endregion
    }
}